<?php

namespace App\Library\Requests\Invite;

use App\Library\Requests\Base\BaseDTORequest;
use App\Library\Rules\IdNumRule;
use App\Library\Rules\MediaImgRule;
use App\Library\Rules\MediasImgRule;

class CertificationApplyRequest extends BaseDTORequest
{
    public function rules(): array
    {
        $com = __('com');
        return [
            'storeName' => 'nullable|string|max:20',
            'storeAvatarFileId' => ['nullable', 'string', 'size:20', new MediaImgRule],
            'realName' => 'required|string|max:20',
            'idNum' => ['required', 'string', 'size:18', new IdNumRule],
            'authFileId' => ['required', 'string', 'size:20', new MediaImgRule],
            'authReverseFileId' => ['required', 'string', 'size:20', new MediaImgRule],
            'authHandFileId' => ['nullable', 'string', 'size:20', new MediaImgRule],
            'licenceCode' => 'nullable|string|size:18|regex:' . $com['licenceCodeReg'] . '|unique:invite_certification,licence_code',
            'licenceFileId' => ['nullable', 'string', 'size:20', new MediaImgRule],
            'certification' => ['nullable', 'array', new MediasImgRule],
        ];
    }
}
